package com.twu.biblioteca;

import java.util.ArrayList;

public class checkout_book {
    public boolean checkout(String num,String book,ArrayList<book> book_list){
        for (int i =0; i< book_list.size();i++){
            if (book_list.get(i).getBookname().equals(book)&&book_list.get(i).getBookstatus()==0){
                book_list.get(i).setBookstatus(1);
                book_list.get(i).setBookholder(num);
                System.out.println("Thank you! Enjoy the book");
                return true;
            }
        }
        System.out.println("That book is not available");
        return false;
    }
}
